<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:zanata="http://java.sun.com/jsf/composite/zanata"
  template="../WEB-INF/template/template_nobanner.xhtml">

  <f:metadata>
    <f:event type="preRenderView" listener="#{passwordReset.validateActivationKey}"/>
    <f:viewParam name="key" value="#{passwordReset.activationKey}"/>
  </f:metadata>

  <ui:define name="page_title">#{msgs['jsf.ResetPassword']}</ui:define>
  <ui:define name="center_content">
    <div class="header__logo-only">
      <h:link outcome="/public/home.xhtml" id="home" tabindex="1">
        <img src="#{request.contextPath}/resources/assets/img/logo/logo.svg" alt="Zanata"/>
      </h:link>
    </div>

    <div class="g--centered">
      <div class="g__item l--constrain-small">
        <div class="l--push-v-1">
          <a4j:outputPanel ajaxRendered="true" layout="block" id="messages">
            <h:messages globalOnly="true"
              styleClass="list--no-bullets"
              errorClass="message--danger app-error l--push-bottom-half"
              infoClass="message--highlight l--push-bottom-half"
              warnClass="message--warning l--push-bottom-half"
              rendered="#{showGlobalMessages != 'false'}"/>
          </a4j:outputPanel>
          <div class="l--push-top-half g__item">
            <h2 class="gamma heading--sub">#{msgs['jsf.ResetPassword']}</h2>
            <h:form id="passwordResetActivationForm" styleClass="l--push-top-half l--pad-all-1 bg--pop-higher">
              <zanata:decorate id="passwordFieldContainer" componentId="passwordField">
                <h:outputLabel for="password">#{msgs['jsf.NewPassword']}</h:outputLabel>
                <h:inputSecret id="password" redisplay="true" required="true"
                  value="#{passwordReset.password}">
                  <a4j:ajax event="blur" render="passwordField"/>
                </h:inputSecret>
              </zanata:decorate>
              <zanata:decorate id="confirmPasswordFieldContainer" componentId="passwordConfirmField">
                <h:outputLabel for="passwordConfirm">#{msgs['jsf.ConfirmPassword']}</h:outputLabel>
                <h:inputSecret id="passwordConfirm" redisplay="true" required="true"
                  value="#{passwordReset.passwordConfirm}">
                  <a4j:ajax event="blur" render="passwordConfirmField"/>
                </h:inputSecret>
              </zanata:decorate>
              <h:commandButton id="resetPasswordButton" styleClass="l--push-top-1 button--primary button--full"
                value="#{msgs['jsf.ChangePassword']}"
                action="#{passwordReset.changePassword}"/>
            </h:form>
          </div>
        </div>
      </div>
    </div>
  </ui:define>
</ui:composition>
